a. Field of Invention
The present invention relates generally to an image encoding device which compresses and encodes images. The invention also relates generally to an electronic camera which is equipped with the image encoding device. The invention further relates generally to an image encoding program which is used to realize the image encoding device in a computer, and a recording medium for the image encoding program.
b. Description of Related Art
In December of 1999, a committee draft (CD) of the JPEG2000 encoding algorithm was prepared, and the main technical content forming the core of this draft was finalized.
The processing steps of the JPEG2000 encoding algorithm will be outlined below.
(1) Color Coordinate Transformation
The input image is subjected to a color coordinate transformation as required.
(2) Wavelet Transformation
The image is subjected to discrete wavelet transformation in the vertical and horizontal directions, and is divided into a plurality of sub-bands (LL, LH, HL, HH). Among these sub-bands, the LL band of the lowest frequency region is repeatedly subjected to debunching wavelet transformation in a recursive manner.
(3) Quantization
The wavelet transformation coefficients are quantized by each sub-band. Moreover, in lossy/lossless unified processing, the quantization step is set at “1.” Furthermore, in the case of lossy compression, the less significant N bit planes are discarded in a post-process. This discarding process is equivalent to the quantization step of the Nth power of 2.
(4) Bit Modeling
Following quantization, the wavelet transformation coefficients are divided into encoding blocks of a fixed size (e.g., 64×64) within each sub-band. Next, the transformation coefficients within each encoding block are divided into sign bits and absolute values, and the absolute values are expressed in binary representation to construct bit planes. The bit planes are then encoded in order from the upper bit plane via the following three types of encoding passes; significance pass, refinement pass and cleanup pass. Furthermore, immediately after the uppermost bits of the corresponding absolute values have appeared on the bit plane, the sign bits are encoded.
(5) ROI (Region of Interest) Encoding
In this function, in order to improve the decoded image quality of a selected region, a greater quantity of information is allocated to a selected region on the image. Specifically, the transformation coefficients (following quantization) that are positioned in the selected region are shifted upward by S bits, and are then subjected to the bit modeling, discussed above. As a result, the selected region is shifted to the upper bit planes and is encoded with a higher priority than any bit of the non-selected region.
Moreover, in the max shift method, the bit shift number S is set so that it is larger than the place number of the uppermost bit in the non-selected region. Accordingly, the non-zero transformation coefficients of the selected region always have a value of the Sth power of 2 or greater. Consequently, during decoding, the transformation coefficients of the selected region can easily be reproduced by selectively shifting quantized values of the Sth power of 2.
(6) Arithmetical Encoding
(7) Bit Stream Formation
Signal-to-Noise Ratio (SNR) progressive and space resolution progressive, are realized by arranging the data of the respective encoding blocks according to combinations of four axes; importance of bit plane, space resolution, block position and color components.
For example, in the case of SNR progressive, the respective encoding blocks are split for each encoding pass, and the split data is classified according to the degree of contribution to the improvement of SNR, so that a plurality of layers are constructed. An SNR progressive bit stream is formed by lining these layers in a top-down order. Additionally, fixed-length compression can be realized by cutting this bit stream using an appropriate file size.
Thus, a JPEG2000 compressed image file is produced by such an encoding procedure.
It should be noted that the most recent and complete developments on JPEG2000 are available in the final committee draft published by the JPEG Committee on the internet at http://www.jpeg.org/fed15444-1.zip. Additionally, following the approval of international standards planned for March 2001, more detailed and accurate international standards can be ascertained via ISO, ITU-T and other standards organizations.
As discussed above, in the case of JPEG2000, the processing content of ROI encoding is regulated. The designation of the selected region, however, is not particularly regulated, but is left up to a user's discretion. Accordingly, in the specific realization of ROI encoding, there is a need for the establishment of more appropriate selected region designation.
In particular, in the case of electronic cameras, fixed-length compression in which the amount of compressed code is more or less fixed is ordinarily performed. In the case of such fixed-length compression, the quantity of information for the non-selected region is reduced by allocating a greater quantity of information to the selected region. This leads to problems such as a noticeable drop in the image quality of the non-selected region as a result of unplanned region designation.
Accordingly, one object of the present invention is to perform appropriate region designation of the selected region.
Furthermore, another object of the present invention is to achieve an appropriate balance in image quality between the selected region and non-selected region in fixed-length compression.